BASE_DIR = ../..
include $(BASE_DIR)/include.mak

TARGET = APP_Retawq

EXPORTED_OBJS = $(PSPRADIO_DIR)/PSPRadioExports.o 
OBJS = plugin_main.o init.o main.o parser.o resource.o stuff.o pspcurses.o psp.o \
		$(EXPORTED_OBJS)

USE_PSPSDK_LIBC = 0
# Define the name of our custom exports (minus the .exp extension)
PRX_EXPORTS=$(PLUGINS_DIR)/APP_Exports.exp

INCDIR = ./ $(PLUGINS_DIR) $(BASE_DIR) $(PSPRADIO_DIR) $(PSPRADIO_DIR)/ScreenHandler \
		 $(SHAREDLIB_DIR)/PSPApp \
		 $(SHAREDLIB_DIR)/libpspnet $(SHAREDLIB_DIR)/libiniparser \
		 $(SHAREDLIB_DIR)/Logging $(SHAREDLIB_DIR)/danzeff \
		 $(PLUGINS_DIR)/Common
MY_CFLAGS = $(GLOBAL_CFLAGS) -DUSE_DANZEFF
CFLAGS = $(MY_CFLAGS) $(EXTRA_FLAGS) -G0 -O0 -g -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR = $(SHAREDLIB_DIR)/lib $(PLUGINS_DIR)/Common
LDFLAGS =
DANZEFF_LIBS = -ldanzeffgu -lpng -lz -lm  -lpspgu -lpspaudio -ljpeg -lpsphprm
LIBS = $(DANZEFF_LIBS) -lpspsdk -lpspwlan -lpspnet -lPluginCommon

the_pbp: $(OBJS) EBOOT.PBP

the_prx: $(TARGET).prx

prx:
	make BUILD_PRX=1 the_prx

stand_alone: 
	make EXTRA_FLAGS="-DSTAND_ALONE_APP" EXPORTED_OBJS="" COMMON_OBJS="" the_pbp

clean2:
	rm -f *.o *.elf *.prx *.pbp *.PBP

install:
	cp -vf $(TARGET).prx $(PSPRADIO_RELEASE_DIR)
	mkdir -p $(PSPRADIO_RELEASE_DIR)/$(TARGET)
	cp -vf tips.html $(PSPRADIO_RELEASE_DIR)/$(TARGET)

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
